const merge = <T, U>(arg1: T, arg2: U): T&U => {
    return Object.assign(arg1, arg2);
};

const getLength = (content: (string|number)): number => {
    if (typeof content === "string") {
        return content.length;
    } else {
        return content.toString().length;
    }
};

interface ISquare {
    kind: "square";
    size: number;
}

interface IRectangle {
    kind: "rectangle";
    height: number;
    width: number;
}

interface ICircle {
    kind: "circle";
    radius: number;
}
type Shape= ISquare|IRectangle|ICircle;
function getArea(s: Shape) {
    switch (s.kind) {
        case "square": return s.size * s.size; break;
            case "rectangle": return s.height * s.width; break;
            case "circle": return Math.PI * s.radius ** 2; break;
    }
}